package com.fakesmoker.aidawnda.config;/**
 * @program: aidawnda
 * @author: lcy
 * @create: 2024-11-16 23:33
 */

/**
 2024/11/16,
 */

import com.zhipu.oapi.ClientV4;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.TimeUnit;


/**
 * 智谱ai 平台调用配置类
 * @author: lcy
 */
@Configuration
@ConfigurationProperties(prefix = "ai")
@Data
public class AiConfig {
    /**
     * 默认的key
     */
    private String apiKey;

    @Bean
    public ClientV4 getClientV4() {
        //构建客户端
        return new ClientV4.Builder(apiKey)
                .networkConfig(30,60,60,60, TimeUnit.SECONDS)
                .build();
    }



}
